package org.deschutter.hibernate;

import javax.persistence.*;

/**
 * User: Berten De Schutter
 * Date: 01-Oct-2009
 * Time: 13:37:59
 */
@Entity
@Table(catalog = "scimitar", name = "alliances")
public class Alliances {
    private int rank;

    @Basic
    @Column(name = "rank")
    public int getRank() {
        return rank;
    }

    public void setRank(int rank) {
        this.rank = rank;
    }

    private String name;

    @Id
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    private int size;

    @Basic
    @Column(name = "size")
    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    private int members;

    @Basic
    @Column(name = "members")
    public int getMembers() {
        return members;
    }

    public void setMembers(int members) {
        this.members = members;
    }

    private long score;

    @Basic
    @Column(name = "score")
    public long getScore() {
        return score;
    }

    public void setScore(long score) {
        this.score = score;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Alliances alliances = (Alliances) o;

        if (members != alliances.members) return false;
        if (rank != alliances.rank) return false;
        if (score != alliances.score) return false;
        if (size != alliances.size) return false;
        if (name != null ? !name.equals(alliances.name) : alliances.name != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = rank;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + size;
        result = 31 * result + members;
        result = 31 * result + (int) (score ^ (score >>> 32));
        return result;
    }
}
